import React, { Component } from 'react'
import PropTypes from 'prop-types'

import {
  Form,
  Input
} from 'antd';


export default class AddForm extends Component {
  static propTypes = {
    setForm: PropTypes.func.isRequired
  }

  myRefAdd = React.createRef()

  componentDidMount () {
    this.props.setForm(this.myRefAdd.current)
  }

  render () {
    return (
      <Form
        ref={this.myRefAdd}
      >

        <Form.Item
          label="角色名称"
          name="roleName"
          rules={[
            {
              required: true,
              message: '请输入角色名称!',
            },
          ]}
        >
          <Input placeholder="请输入角色名称" />
        </Form.Item>
      </Form>
    )
  }
}
